package knapsackga;

import java.util.List;


public interface Genome
{

    /**
     * Returns the "children" of this genome crossover with the given genome. It
     * doesn't modify this genome or the given one.
     * 
     * @param other_parent the other genome to crossover this genome with
     * @return the resulting children
     */
    public List<Genome> crossover( Genome other_parent );

    /**
     * Returns an in-place mutated form of this genome. I.e. The mutation
     * modifies this genome.
     */
    public void mutate( double bit_mutation_probability );

    /**
     * Creates an exact copy, a clone, of this genome.
     * 
     * @return a clone of this genome
     */
    // not named clone() due to the existence of the method Object.clone()
    public Genome makeClone();

    /**
     * Returns the fitness of this genome.
     * 
     * @return the genomes fitness
     */
    double getFitness();

    /**
     * Sets the fitness of this genome.
     * 
     * @param fitness
     */
    public void setFitness( double fitness );

    /**
     * Returns the alleles of the genome
     */
    int[] getAlleles();
}
